package com.stox.shared.core.model;

import com.stox.shared.core.util.StringUtil;


public class Exchange extends AbstractModel {
	private String iconImagePath;
	
	public Exchange(String text) {
		String[] tokens = text.split(",");
		if(0 < tokens.length && StringUtil.hasText(tokens[0])) setId(Long.parseLong(tokens[0]));
		if(1 < tokens.length && StringUtil.hasText(tokens[1])) setName(tokens[1]);
		if(2 < tokens.length && StringUtil.hasText(tokens[2])) setIconImagePath(tokens[2]);
	}
	
	@Override
	public String toString() {
		return String.valueOf(getId())+","+getName()+","+(null == getIconImagePath() ? "" : getIconImagePath());
	}
	
	public String getIconImagePath() {
		return iconImagePath;
	}
	
	public void setIconImagePath(String iconImagePath) {
		this.iconImagePath = iconImagePath;
	}
	
}
